
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head>
<title>首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	<div class="container" id="content">
		<section class="content-header">
			<h1>
				<i class="fa fa-renren"></i> <strong>客户来访信息</strong>
			</h1>
			<ol class="breadcrumb">
				<li><a href="#"><i class="fa fa-home "></i>Home</a></li>
				<li>客户来访管理</li>
				<li class="active">客户来访编辑</li>
			</ol>
		</section>
		<!-- Main content -->
		<section class="content">
			<div class="row">
				<div class="col-md-12">
					<div class="box box-info" id="customerVisit">
						<div class="box-header with-border">
							<i class="fa fa-th-list"></i>
							<h4 class="box-title">客户来访信息</h4>
						</div>
						<div class="widget-content nopadding">
							<input type="hidden" name="visitId" id="visitId" th:value="${visit.id}"/> <input
								type="hidden" name="visitcreateTime" id="visitcreateTime" th:value="${visit.createTime}"/>
							<table class="table table-bordered">
								<tbody>
									<tr class="odd gradeX">
										<td width="8%" class="center">客户名称</td>
										<td colspan="5">
											 <div class="col-sm-10">
											    <input type="hidden" name="customer" id="customer" th:value="${visit.customer.id}"/>
											    <input class="form-control" type="text" id="orderUnit" name="orderUnit" 
											        datatype="*,*1-100,t" nullmsg="请引入客户单位" readonly="readonly"
											        th:value="${visit.customer.customerName}"/>   
											 </div>
											 <div class="col-sm-1">
				                               <span style="color:#F00">*</span>
				                             </div>
				                             <div class="col-sm-1">
												<button type="button" id="queryCustomer" class="btn btn-info" title="引入客户信息"><i class="fa fa-search"></i></button>
											 </div>
										</td>
									</tr>
									<tr class="odd gradeX">
									    <td width="8%" class="center">单位地点</td>
										<td colspan="3">
										  <div class="col-sm-11">
										   <input class="form-control" type="text"
											id="address" name="address" readonly="readonly" 
											th:value="${visit.customer.address}"/>
										  </div>
										</td>
										<td width="8%" class="center">单位编号</td>
										<td width="16%">
										  
										   <input class="form-control" type="text"
											id="address" name="address" readonly="readonly" 
											th:value="${visit.customer.customerCode}"/>
										
										</td>
									</tr>
									<tr class="odd gradeX">
										<td width="8%" class="center">信用评分</td>
										<td width="16%">
										  <div class="col-sm-11">
										   <input type="text" id="creditLevel"
											name="creditLevel" class="form-control" readonly="readonly" 
											th:value="${visit.customer.creditLevel}"/>
										  </div>
										</td>
										<td width="9%" class="center">项目名称及产品</td>
										<td width="16%">
										  <div class="col-sm-11">
										   <input class="form-control" type="text"
											id="project" name="project" datatype="*,*1-100" nullmsg="请输入项目名称"
											th:value="${visit.project}"/>
										  </div>
										  <div class="col-md-1">
			                               		<span style="color:#F00">*</span>
			                              </div>	
										</td>
										<td width="8%" class="center">项目进展阶段</td>
										<td width="16%"><input class="form-control" type="text"
											id="development" name="development" 
											th:value="${visit.development}"/></td>
									</tr>
									<tr class="even gradeC">
										<td width="8%" class="center">来访时间</td>
										<td width="17%">
										  <div class="col-sm-11">
											<input class="form-control" type="date"
												id="visitingDate" name="visitingDate" 
												th:value="${#dates.format(visit.visitingDate,'YYYY-MM-dd')}"/>
										  </div>
										</td>
										<td width="8%" class="center">预计合同量(元)</td>
										<td width="16%">
										  <div class="col-sm-11">
											  <input class="form-control" type="text"
												id="contractAmount" name="contractAmount" 
												th:value="${visit.contractAmount}" datatype="n"/>
										  </div>
										</td>
										<td width="8%" class="center" style="display: none;">机会名称</td>
										<td width="17%" style="display: none;"><input class="form-control" type="text"
											id="chance" name="chance" th:value="${visit.chance}"/></td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="box-header with-border">
							<i class="fa fa-th-list"></i>
							<h4 class="box-title">客户来访人员</h4>
						</div>
						<div class="box-body">
							<div class="form-inline">
								<button class="btn btn-info pull-right deletePersonBtn">删除</button>
                                <button class="btn btn-info pull-right editPersonBtn">编辑</button>
                                <button class="btn btn-info pull-right addPersonBtn">添加</button>
							</div>
							<table id="personTable"
								class="mytable dataTable table-bordered text-center table-striped table-hover display"  cellspacing="0">
								<thead>
									<tr>
										<th width="10%">序号</th>
                                        <th width="10%"><input type="checkbox" id="checkAll1"/></th>
										<th width="15%">对象</th>
										<th width="15%">部门</th>
										<th width="10%">职务</th>
										<th width="10%">联系方式</th>
										<th width="10%">总人数</th>
									</tr>
								</thead>
								<tbody>

								</tbody>
							</table>
						</div>
						<div class="box-header with-border">
							<i class="fa fa-th-list"></i>
							<h4 class="box-title">客户来访费用</h4>
						</div>
						<div class="box-body">
							<div class="form-inline">
								<button class="btn btn-info pull-right addCostBtn">添加</button>
								<button class="btn btn-info pull-right editCostBtn">编辑</button>
								<button class="btn btn-info pull-right deleteCostBtn">删除</button>
							</div>
							<table
								class="mytable dataTable table-bordered text-center table-striped table-hover"
								id="costTable">
								<thead>
									<tr>
									    <th width="10%">序号</th>
                                        <th width="10%"><input type="checkbox" id="checkAll2"/></th>
										<th width="20%">费用名称</th>
										<!-- <th width="20%">单价</th> -->
										<th width="20%">数量（人）</th>
										<th width="20%">总价（元）</th>
									</tr>
								</thead>
								<tbody>

								</tbody>
							</table>
						</div>
						<div class="box-body">
							<table class="table table-bordered">
								<tbody>
									<tr class="even gradeC">
										<td width="8%" class="center">经办人</td>
										<td width="17%"><input class="form-control" type="text"
											id="operator" name="operator" th:value="${visit.operator}"/></td>
										<td width="8%" class="center">证明人</td>
										<td width="16%"><input class="form-control" type="text"
											id="prove" name="prove" th:value="${visit.prove}"/></td>
										<td width="8%" class="center">片区</td>
										<td width="16%">
											<input class="form-control" type="text"
											id="superiorArea" name="superiorArea" readonly="readonly"
											th:value="${visit.saleArea.superiorArea}"/>
										  	<input type="hidden" class="form-control" id="saleArea" 
										  	    th:value="${visit.saleArea.id}"/>
										</td>
									</tr>
									<tr class="even gradeC">
										<td width="8%" class="center">费用归属</td>
										<td width="17%"><input class="form-control" type="text"
											id="costAtrr" name="costAtrr" th:value="${visit.costAtrr}"/></td>
									</tr>
									<tr class="odd gradeX">
										<td class="center">备注</td>
										<td colspan="7"><textarea class="form-control"
												style="width: 100%" id="memo" name="memo" rows="3"
												th:text="${visit.memo}"></textarea>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="box-body">
							<a type="button" class="btn btn-info pull-right"
								href="javascript:history.go(-1)">返回</a>
							<button type="button" class="btn btn-info pull-right saveBtn">保存</button>
						</div>
					</div>
				</div>
			</div>
		</section>
		<!--用户来访人员添加弹窗-->
		<div class="modal" id="visitingPersonModal">
			<div class="modal-dialog" role="dialog">
					<div class="modal-content" id="visitingPersonForm">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>客户来访人员</strong>
							</h4>
						</div>
						<div class="modal-body">
							<input type="hidden" name="personId" id="personId" />
							<input type="hidden" name="personcreatetime" id="personcreatetime" />
							<div class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">对象</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="name" id="name"
												datatype="*,*1-100" nullmsg="请输入对象" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00; fontsize: 30px">*</span>
										</div>
									</div>
									<label class="col-sm-2 control-label">部门</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="department"
												id="department" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">职务</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" id="position"
												name="position" />
										</div>

									</div>
									<label class="col-sm-2 control-label">联系方式</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="contractType"
												id="contractType" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">总人数</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="personNum"
												id="personNum" datatype="d"/>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="modal-footer">
                            <button type="button" class="btn btn-primary savePersonBtn">保存</button>
							<button type="button" class="btn btn-default" data-dismiss="modal">返回</button>

						</div>
					</div>

			</div>
		</div>
		<!--来访人员弹窗-->
		<!--用户来访费用添加弹窗-->
		<div class="modal" id="visitingCostModal">
			<div class="modal-dialog" role="dialog">
					<div class="modal-content" id="visitingCostForm">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>客户来访费用</strong>
							</h4>
						</div>
						<div class="modal-body">
							<input type="hidden" name="costId" id="costId" />
							<input type="hidden" name="costcreatetime" id="costcreatetime" />
							<div class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">费用名称</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="costName" id="costName"
												datatype="*,*1-100" nullmsg="请输入名称" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00; fontsize: 30px">*</span>
										</div>
									</div>
									<label class="col-sm-2 control-label">数量（人）</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" id="amount"
												name="amount" datatype="*,d" nullmsg="请输入数量" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00; fontsize: 30px">*</span>
										</div>
									</div>
									<!-- <label class="col-sm-2 control-label">单价</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="price"
												id="price" datatype="*,n" nullmsg="请输入单价" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00; fontsize: 30px">*</span>
										</div>
									</div> -->
								</div>
								<div class="form-group">
									
									<label class="col-sm-2 control-label">总价（元）</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="totalPrice"
												id="totalPrice" datatype="n"/>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="modal-footer">
                            <button type="button" class="btn btn-primary saveCostBtn">保存</button>
							<button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
						</div>
					</div>

			</div>
		</div>
		
		<script th:src="@{/customerVisiting/customerVisitingEdit.js}"></script>
	</div>
</body>
</html>
